// Finds the most frequent neighborhoods in a collection of replays
class NeighborhoodFeatureSet
{
public:
    // size controls the size of the neighborhoods
    void buildFromReplays(const ReplayCollection &replays, int num, int size, int gridScale);
    
    void saveToFile(const string &filename) const;
    
    void loadFromFile(const string &filename);

    void exportPNGs(const SpriteCollection &spriteCollection, const string &dirname) const;

    void encodeFrame(const FrameGrid &frame, vector<double> &out) const;

    friend OutputDataStream & operator<< (OutputDataStream &os, const NeighborhoodFeatureSet &nfs);
    friend InputDataStream & operator>> (InputDataStream &is, NeighborhoodFeatureSet &nfs);
private:
    int _size;
    set<Neighborhood> features;
};

OutputDataStream & operator<< (OutputDataStream &os, const NeighborhoodFeatureSet &nfs);
InputDataStream & operator>> (InputDataStream &is, NeighborhoodFeatureSet &nfs);